package com.zzy.module.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzy.common.entity.db.AdminDaoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author zhuZhaoYang
 * @date 2021/12/4 19:28
 */
@Mapper
public interface AdminMapper extends BaseMapper<AdminDaoEntity> {

    /**
     * 修改密码
     *
     * @param password 密码
     * @param id       用户id
     */
    @Update("update admin set password=#{password} where id = #{id}")
    void myUpdate(@Param("password") String password, @Param("id") Integer id);

    /**
     * 登录返回身份
     *
     * @param actorType 用户名
     * @return 返回
     */
    @Select("select actor.name from actor where id = #{actorType}")
    String returnIdentity(@Param("actorType") Integer actorType);
}
